
<%--/*
- * @description: 商品详情页
- * @author: huangchuting
- * @update: huangchuting (2021/1/7 22:10)
- */--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>校园租赁-商品详情页</title>
</head>
<link rel="stylesheet" href="/static/css/item-news.css">
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<script type="text/javascript">
    function goOrder(){
        $.ajax({
            type: "Post",
            url: "/Home/order",      //你的controller地址
            data: {item_id:${itemNew.item_id}},
            success: function (data) {

            }
        });
    }
</script>
<body>
    <c:import url="../public/head.jsp"></c:import>
    <script>
        shop.innerHTML = '<span>·&#12288;商品详情页</span>'
    </script>
    <div class="divWarp">
        <div class="contentWarp">
            <div class="infoWarp">
                <div class="imageWarp">
                    <img src="/static/images/item/${itemNew.image}">
                </div>
                <div class="newWarp">
                    <span class="item_name">${itemNew.item_name}</span>
                        <c:if test="${itemNew.item_state==1}">
                            <span style="color: crimson">[未出售]</span>
                        </c:if>
                        <c:if test="${itemNew.item_state==0}">
                        <span style="color: darkgray">[已出售]</span>
                        </c:if>
                    <br>
                    <span class="item">商品价格：</span><span class="price">${itemNew.price}</span><br>
                    <span class="item">商品类型：${itemNew.type}</span><br>
                    <span class="item">关注人数：</span><span class="price">${itemNew.love_user_num}</span><br>
                    <img src="/static/images/user/seller.png" class="sellerImg"><span class="seller">&nbsp;&nbsp; ${userNew.user_name}</span><br>
                    <img src="/static/images/user/phone.png" class="sellerImg"><span class="seller">&nbsp;&nbsp; ${userNew.phone}</span><br>
                    <a href="#"><div class="Btn">加入关注</div></a>
                    <c:if test="${itemNew.item_state==1}">
                        <a href="/Item/goOrder?item_id=${itemNew.item_id}"><div class="Btn">立即下单</div></a><br>
                    </c:if>
                    <c:if test="${itemNew.item_state==0}">
                        <a><div class="Btn"  style="background:darkgray">立即下单</div></a><br>
                    </c:if>
                    <br>
                    <span class="tips">*发布时间：${itemNew.publish_time}</span>
                </div>
            </div>
            <div class="introWarp">
                <h4>商品简介：</h4>
                <span class="intro">${itemNew.introduction}</span>
            </div>

                <c:if test="${itemNew.getUser_id()== sessionScope.user_id}">
                    <c:if test="${bool != 0}">
                        <div class="orderDiv">
                            <table>
                                <tr>
                                    <th>订单编号</th>
                                    <th>收货人</th>
                                    <th>收货地址</th>
                                    <th>联系方式</th>
                                </tr>
                                <tr>
                                    <td><a href="/Order/orderCommit?order_id=${ordersNew.order_id}">${ordersNew.order_id}</a></td>
                                    <td>${ordersNew.consignee}</td>
                                    <td>${ordersNew.addr}</td>
                                    <td>${ordersNew.contact_way}</td>
                                </tr>
                            </table>
                        </div>
                    </c:if>

                </c:if>

        </div>
    </div>
</body>
</html>